﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Rhomble.Data.Customers
{
	public static class CustomerFilters
	{
		#region Order By

		public static IOrderedQueryable<Customer> DefaultOrder(this IQueryable<Customer> source)
		{
			return OrderByName(source);
		}

		public static IOrderedQueryable<Customer> OrderByName(this IQueryable<Customer> source)
		{
			return source.OrderBy(c => c.Name);
		}

		#endregion

		public static IQueryable<Customer> WithID(this IQueryable<Customer> source, Guid customerID)
		{
			return source.Where(c => c.CustomerPK == customerID);
		}
	}
}
